<div
  bsModal
  #actionModal="bs-modal"
  class="modal fade"
  tabindex="-1"
  role="dialog"
  aria-labelledby="actionModal"
  aria-hidden="true"
  [config]="{ backdrop: 'static' }"
>
  <div class="modal-dialog {{modalSize}} {{isFullScreen?'modal-full-screen':''}}">
    <div class="modal-content" style="height: 100%;">
      <form *ngIf="active" #editForm="ngForm" novalidate>
        <div class="modal-header">
          <h4 class="modal-title">
            <span>{{ actCode }}</span> &nbsp;&nbsp;&nbsp;<span class="text-success"
              >{{ pipeline.taskCode }}&nbsp;&nbsp;|&nbsp;&nbsp;{{ pipeline.drawingCode }}</span
            >
          </h4>

          <div class="modal-header__head-tools">
            <ul class="modal-header__nav">
              <li class="modal-header__nav-item">
                <a
                  href="javascript:;"
                  (click)="fullScreen()"
                  title="{{isFullScreen?'取消全屏':'全屏'}}"
                  modal-header-tool="fullscreen"
                  class="modal-header__nav-link modal-header__nav-link--icon"
                >
                  <i class="la la-expand"></i>
                </a>
              </li>
              <li class="modal-header__nav-item">
                <a
                  href="javascript:;"
                  (click)="close()"
                  title="关闭窗口"
                  modal-header-tool="remove"
                  class="modal-header__nav-link modal-header__nav-link--icon"
                >
                  <i class="la la-close"></i>
                </a>
              </li>
            </ul>
          </div>
        </div>

        <div class="modal-body">
          <div class="full-screen-content {{isFullScreen?'m-scrollable m-scrollable-full-screen':''}}">
            <!-- 工序信息 -->
            <div class="row work-shop-proc">
              <div class="col-md-3 pr-0">
                <div style="padding: 10px;">
                  <!-- <div class="h4" style="height: 30px;">
                    工位选择 <span>{{ ip }}</span>
                  </div> -->
                  <!-- <div class="form-group">
                    <div class="row">
                      <div class="col-9">
                        <select
                          name="station"
                          class="form-control form-control-sm"
                          [(ngModel)]="stationId"
                          title="选择工位"
                          (change)="selectChange()"
                          required
                        >
                          <option *ngFor="let station of ipStations" [value]="station.id">{{
                            station.stationName
                          }}</option>
                        </select>
                      </div>
                      <div class="col-3" style="padding-left: 0;margin: auto;">
                        <div class="m-checkbox-list">
                          <label for="IsShowAllStations" class="m-checkbox">
                            <input
                              id="IsShowAllStations"
                              type="checkbox"
                              name="isShowAllStations"
                              [(ngModel)]="isShowAllStations"
                              (change)="checkboxChange()"
                            />
                            全选 <span></span>
                          </label>
                        </div>
                      </div>
                    </div>
                  </div>
                  <hr /> -->
                  <div>
                    <h4 style="height: 30px;">基础信息</h4>
                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">任务</span> <code>{{ procInfo.subTaskCode }}</code>
                    </div>
                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">图号</span> <code>{{ procInfo.drawingCode }}</code>
                    </div>

                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">名称</span> <code>{{ procInfo.taskName }}</code>
                    </div>

                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">数量</span> <code>{{ procInfo.amountPlanned }}</code>
                    </div>

                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">工艺</span> <code>{{ procInfo.techDocCode }}</code>
                    </div>

                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">质控</span> <code>{{ procInfo.zhiKongKaNo }}</code>
                    </div>

                    <!-- <div class="proc-info-item">
                      <span class="m-badge m-badge--success">组员</span> <code>{{ procInfo.assignedToUserName }}</code>
                    </div>

                    <div class="proc-info-item">
                      <span class="m-badge m-badge--success">时间</span> <code>{{ procInfo.assignedToUserDate }}</code>
                    </div> -->
                  </div>
                </div>
              </div>

              <div class="col-md-9 pl-0">
                <div style="padding: 10px;">
                  <div class="alert alert-info">
                    <div class="row">
                      
                        <!-- <div class="col-lg-6">
                          <div class="note note-success" style="padding: 11px;">
                            <h5 class="block">工序状态:</h5>
                            <em>{{ procInfo.statusName }}</em>
                          </div>
                        </div> -->
                     
                        <div class="col-lg-6">
                          <div class="note note-success" style="padding: 11px;">
                              <h5 class="block">是否外协:</h5>
                              <p-checkbox [(ngModel)]="checked" [binary]='true'name="checked"></p-checkbox>
                          </div>
                        </div>
                    </div>
                  </div>

                  <div *ngFor="let procAndAct of procAndActView">
                    <div class="alert" style="border-color: #45aaf8;">
                      <div class="row">
                        <div class="col-lg-4">
                          <div class="proc-info-item" style="height:22px!important">
                            <span class="m-badge m-badge--success">工序</span>
                            <code>{{ procAndAct.actCode }}{{ procAndAct.actName }}</code>
                          </div>
                        </div>
                        <div class="col-lg-2">
                          <div class="proc-info-item" style="height:22px!important">
                            <!-- <span class="m-badge m-badge--success">工序状态</span> -->
                            <code>{{ procAndAct.statusName }}</code>
                          </div>
                        </div>
                        <div class="col-lg-6">
                          <div class="proc-info-item" style="height:22px!important">
                            <div
                              class="m-btn-group m-btn-group--pill btn-group"
                              role="group"
                              aria-label="..."
                              style="width: 100%;height: 22px;"
                            >
                              <button
                                type="button"
                                class="m-btn btn btn-outline-info"
                                style="width: 20%;line-height: 2px"
                                (click)="start()"
                                [disabled]="
                                  
                                  (procAndAct.statusName !== '初始' && procAndAct.statusName !== '暂停')
                                "
                              >
                                开 始
                              </button>
                              <button
                                type="button"
                                class="m-btn btn btn-outline-danger"
                                style="width: 20%;line-height: 2px"
                                (click)="pause()"
                                [disabled]="procAndAct.statusName !== '进行'"
                              >
                                暂 停
                              </button>
                              <button
                                type="button"
                                class="m-btn btn btn-outline-success"
                                style="width: 20%;line-height: 2px"
                                (click)="finish()"
                                [disabled]="procAndAct.statusName !== '进行'"
                              >
                                完 成
                              </button>
                              <button
                                type="button"
                                class="m-btn btn btn-outline-default"
                                style="width: 20%; line-height: 2px"
                                (click)="restart()"
                                [disabled]=" procAndAct.statusName == '初始'"
                              >
                                重 置
                              </button>
                              <button
                                type="button"
                                class="btn btn-primary blue"
                                style="width: 20%;line-height: 2px"
                                [disabled]="!editForm.form.valid"
                                [buttonBusy]="runing"
                                [busyText]="'运行中...'"
                                (click)="run()"
                              >
                                运行
                              </button>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{ l('Cancel') }}</button>
        </div>
      </form>
    </div>
  </div>
</div>
